use strict;
use warnings;

use Test::More;
use Test::Base;
plan tests => (1 + blocks);

use MT::App::Test;
use File::Basename;
use File::Spec;

my $app = MT::App::Test->test_instance_of(
	#force_initialize_database => 1,
	data_dirs => dirname(File::Spec->rel2abs(__FILE__)),
	fixtures => File::Spec->catdir(
		dirname(File::Spec->rel2abs(__FILE__)),
		'another_fixtures',
	),
);

sub Test::Base::Filter::template_build {
	my ($self, $str) = @_;
	$app->test_template_build(\$str);
}

sub Test::Base::Filter::php_template_build {
	my ($self, $str) = @_;
	$app->test_php_template_build(\$str);
}

filters {
	input => [qw( chomp )],
	expected => [qw( chomp )],
};


ok(
	$app->test_template_load_context('ctx_2'),
	'test_template_load_context'
);

run_is;

__END__

=== test_template_build
--- input template_build
<mt:BlogName>
--- expected
MT App Test Blog Another

=== test_php_template_build
--- input php_template_build
<mt:BlogName>
--- expected
MT App Test Blog Another

=== test_template_build
--- input template_build
<mt:AuthorName>
--- expected
mt_app_test_another

=== test_php_template_build
--- input php_template_build
<mt:AuthorName>
--- expected
mt_app_test_another
